package cj.web.admin.dao;
/*
 *  
 *  
*/
import java.util.List;
import net.paoding.rose.jade.annotation.DAO;
import net.paoding.rose.jade.annotation.SQL;
import net.paoding.rose.jade.annotation.SQLParam;
import cj.web.admin.domain.AppUserInfo;

/**
 * 
 * @author 
 *
 */
@DAO
public interface AppUserInfoDAO{
	
	@SQL("SELECT * FROM AppUserInfo WHERE deleteFlag=1 #if(:t.id!='' && :t.id!=null){ AND id =:t.id } #if(:t.devicesId!=''){ AND devicesId LIKE '%##(:t.devicesId)%' } ORDER BY updateAt DESC LIMIT :t.start,:t.length ")
    List<AppUserInfo> query(@SQLParam("t") AppUserInfo appUserInfo);
	
	@SQL("SELECT count(*) FROM AppUserInfo WHERE deleteFlag=1 #if(:t.id!='' && :t.id!=null){ AND id =:t.id } #if(:t.devicesId!=''){ AND devicesId LIKE '%##(:t.devicesId)%' } ")
    int querySize(@SQLParam("t") AppUserInfo appUserInfo);
    
    @SQL("SELECT * FROM AppUserInfo WHERE id=:1")
    AppUserInfo queryById(int id);
    
    @SQL("UPDATE AppUserInfo SET state=0 WHERE id=:1")
    void updateStateZC(int id);
    
    @SQL("UPDATE AppUserInfo SET state=1 WHERE id=:1")
    void updateStateJY(int id);
}